// JVisualGUI.java by Matt Fritz
// June 2, 2010
// Handles the execution of the main program window

package mainProgram;

import java.awt.Dimension;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;

import customWindows.WindowComponents;
import customWindows.WindowCustomGUI;
import customWindows.WindowProperties;

// TODO: Add JMenuBar
// TODO: Make shit work
// TODO: Add "Project Explorer" tree view
// TODO: Add "Properties" window when the user clicks on a JComponent
// TODO: Add other shit that I can't really think of right now

public class JVisualGUI extends JFrame
{
	private String titleText = "JVisualGUI 1.00 by Matt Fritz"; // text of the window title
	private JDesktopPane desktopPane; // the pane that holds the internal windows
	private WindowCustomGUI internalWindow; // the first internal window
	private WindowComponents componentsWindow; // the Components window
	private WindowProperties propertiesWindow; // the Properties window
	
	private int numWindowsActive = 0; // how many windows the project contains
	
	public JVisualGUI()
	{
		createMainGUI();
	}
	
	// create the main GUI for the window
	private void createMainGUI()
	{
		// set up the main window
		setLayout(null);
		setTitle(titleText);
		setPreferredSize(new Dimension(1000, 700));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		// set up the internal container
		desktopPane = new JDesktopPane();
		setContentPane(desktopPane);
		desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
		
		// set up the internal window
		numWindowsActive++;
		internalWindow = new WindowCustomGUI("New GUI Window " + numWindowsActive);
		desktopPane.add(internalWindow);
		
		// set up the Components window
		componentsWindow = new WindowComponents();
		desktopPane.add(componentsWindow);
		
		// set up the Properties window
		propertiesWindow = new WindowProperties();
		desktopPane.add(propertiesWindow);
		
		// pack the main frame and display it
		pack();
		setVisible(true);
	}
	
	public static void main(String args[])
	{
		// create a new GUI and display it on-screen
		new JVisualGUI();
	}
}
